package com.strongdigit.ioc.beanannotation.service;

import com.strongdigit.ioc.contract.InjectionDAO;
import com.strongdigit.ioc.contract.InjectionService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

@Service
public class InjectionServiceImpl implements InjectionService2 {


    private InjectionDAO injectionDAO;

//    @Autowired
//    public void setInjectionDAO(InjectionDAO injectionDAO) {
//        this.injectionDAO = injectionDAO;
//    }

    //
//    public void setInjectionDAO(InjectionDAO injectionDAO) {
//        this.injectionDAO = injectionDAO;
//    }
//
    @Autowired
    public InjectionServiceImpl(InjectionDAO injectionDAO) {
        this.injectionDAO = injectionDAO;
    }

    public InjectionServiceImpl() {
    }




    @Override
    public void save(String arg) {
        System.out.println("services接收参数:" + arg);
        arg = arg + ":" + this.hashCode();
        injectionDAO.save(arg);

    }
}